/* NOTICE
 
    Jim - the Java Image Manager, copyright (c) 2005 - 2007 Grant Gardner 
 
    Jim is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Jim is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
    In addition, as a special exception, you are permitted to link this code
    with the 3rd party libraries required to compile this file and to
    distribute a linked combination including them. You must obey the
    GNU General Public License in all respects for all of the code except for
    those 3rd party libraries that are licenced under terms incompatible with the
    GNU General Public License.  
 
 
 NOTICE */

/*
 * Created by dnoakes on 3-Oct-2002 10:10:47 using IntelliJ IDEA.
 */

package au.com.lastweekend.jim.io.exif.makernote.nikon;

import java.util.HashMap;
import java.util.Map;

import au.com.lastweekend.jim.io.metadata.Directory;

/**
 * The type-3 directory is for D-Series cameras such as the D1 and D100. Thanks to Fabrizio Giudici for publishing his
 * reverse-engineering of the D1 makernote data. http://www.timelesswanderings.net/equipment/D100/NEF.html
 * 
 * Additional sample images have been observed, and their tag values recorded in javadoc comments for each tag's field. New tags
 * have subsequently been added since Fabrizio's observations.
 * 
 * @version $Id: NikonType3MakernoteDirectory.java,v 1.3 2006/02/20 12:21:11 ggardner Exp $
 * @author <a href="mailto:grant@lastweekend.com.au"> <Grant Gardner> </a>
 */
public class NikonType3MakernoteDirectory extends Directory {

    /**
     * Values observed - 0200
     */
    public static final int TAG_NIKON_TYPE3_FIRMWARE_VERSION = 1;

    /**
     * Values observed - 0 250 - 0 400
     */
    public static final int TAG_NIKON_TYPE3_ISO_1 = 2;

    /**
     * Values observed - FILE - RAW
     */
    public static final int TAG_NIKON_TYPE3_FILE_FORMAT = 4;

    /**
     * Values observed - AUTO - SUNNY
     */
    public static final int TAG_NIKON_TYPE3_CAMERA_WHITE_BALANCE = 5;

    /**
     * Values observed - AUTO - NORMAL
     */
    public static final int TAG_NIKON_TYPE3_CAMERA_SHARPENING = 6;

    /**
     * Values observed - AF-S
     */
    public static final int TAG_NIKON_TYPE3_AF_TYPE = 7;

    /**
     * Values observed - NORMAL
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_17 = 8;

    /**
     * Values observed -
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_18 = 9;

    /**
     * Values observed - 0
     */
    public static final int TAG_NIKON_TYPE3_CAMERA_WHITE_BALANCE_FINE = 11;

    /**
     * Values observed - 2.25882352 1.76078431 0.0 0.0
     */
    public static final int TAG_NIKON_TYPE3_CAMERA_WHITE_BALANCE_RB_COEFF = 12;

    /**
     * Values observed -
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_1 = 13;

    /**
     * Values observed -
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_2 = 14;

    /**
     * Values observed - 914
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_3 = 17;

    /**
     * Values observed -
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_19 = 18;

    /**
     * Values observed - 0 250
     */
    public static final int TAG_NIKON_TYPE3_ISO_2 = 19;

    /**
     * Values observed - AUTO
     */
    public static final int TAG_NIKON_TYPE3_CAMERA_TONE_COMPENSATION = 129;

    /**
     * Values observed - 6
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_4 = 131;

    /**
     * Values observed - 240/10 850/10 35/10 45/10
     */
    public static final int TAG_NIKON_TYPE3_LENS = 132;

    /**
     * Values observed - 0
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_5 = 135;

    /**
     * Values observed -
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_6 = 136;

    /**
     * Values observed - 0
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_7 = 137;

    /**
     * Values observed
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_8 = 139;

    /**
     * Values observed - 0
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_20 = 138;

    /**
     * Values observed
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_9 = 140;

    /**
     * Values observed - MODE1
     */
    public static final int TAG_NIKON_TYPE3_CAMERA_COLOR_MODE = 141;

    /**
     * Values observed - NATURAL
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_10 = 144;

    /**
     * Values observed - 0100 )
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_11 = 145;

    /**
     * Values observed - 0
     */
    public static final int TAG_NIKON_TYPE3_CAMERA_HUE_ADJUSTMENT = 146;

    /**
     * Values observed - OFF
     */
    public static final int TAG_NIKON_TYPE3_NOISE_REDUCTION = 149;

    /**
     * Values observed - 0100
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_12 = 151;

    /**
     * Values observed - 0100
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_13 = 152;

    /**
     * Values observed
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_14 = 153;

    /**
     * Values observed - 78/10 78/10
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_15 = 154;

    /**
     * Values observed
     */
    public static final int TAG_NIKON_TYPE3_CAPTURE_EDITOR_DATA = 3585;

    /**
     * Values observed
     */
    public static final int TAG_NIKON_TYPE3_UNKNOWN_16 = 3600;

    protected static final HashMap<Integer, String> TAG_NAME_MAP = new HashMap<Integer, String>();

    static {
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_FIRMWARE_VERSION, "Firmware Version");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_ISO_1, "ISO");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_FILE_FORMAT, "File Format");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_CAMERA_WHITE_BALANCE, "White Balance");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_CAMERA_SHARPENING, "Sharpening");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_AF_TYPE, "AF Type");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_CAMERA_WHITE_BALANCE_FINE, "White Balance Fine");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_CAMERA_WHITE_BALANCE_RB_COEFF, "White Balance RB Coefficients");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_ISO_2, "ISO");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_CAMERA_TONE_COMPENSATION, "Tone Compensation");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_LENS, "Lens");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_CAMERA_COLOR_MODE, "Colour Mode");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_CAMERA_HUE_ADJUSTMENT, "Camera Hue Adjustment");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_NOISE_REDUCTION, "Noise Reduction");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_CAPTURE_EDITOR_DATA, "Capture Editor Data");

        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_1, "Unknown 01");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_2, "Unknown 02");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_3, "Unknown 03");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_4, "Unknown 04");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_5, "Unknown 05");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_6, "Unknown 06");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_7, "Unknown 07");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_8, "Unknown 08");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_9, "Unknown 09");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_10, "Unknown 10");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_11, "Unknown 11");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_12, "Unknown 12");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_13, "Unknown 13");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_14, "Unknown 14");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_15, "Unknown 15");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_16, "Unknown 16");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_17, "Unknown 17");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_18, "Unknown 18");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_19, "Unknown 19");
        TAG_NAME_MAP.put(TAG_NIKON_TYPE3_UNKNOWN_20, "Unknown 20");
    }

    public NikonType3MakernoteDirectory(Directory parent) {

        super(parent);
        this.setDescriptor(new NikonType3MakernoteDescriptor(this));
    }

    @Override
    public String getName() {

        return "Nikon(3)";
    }

    @Override
    protected Map<Integer, String> getTagNameMap() {

        return TAG_NAME_MAP;
    }
}